package cj.web.yc.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cj.web.yc.dao.VideoDAO;
import cj.web.yc.domain.Video;

@Service
public class VideoService {
	
	@Autowired
    private VideoDAO videoDAO;

	/**
	 * 查询
	 * @param video
	 * @return videolis;size
	 */
	public Map query(Video video){
		Map rep = new HashMap();
		List<Video> videolis = videoDAO.query(video);
		int size = videoDAO.querySize(video); 
		rep.put("videolis", videolis);
		rep.put("size", size);
		return rep;
    }
	
	public Video queryById(int id){
		Video obj = videoDAO.queryById(id);
		return obj;
    }
	
	public void create(Video video){
		videoDAO.create(video);
	}
	
	public void update(Video video){
		videoDAO.update(video);
	}
	
	public void deleteById(int id){
		videoDAO.deleteById(id);
	}
}
